package edu.wfu.preparedDishes.commodity.service.impl;

import edu.wfu.preparedDishes.common.utils.PageUtils;
import edu.wfu.preparedDishes.common.utils.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import edu.wfu.preparedDishes.commodity.dao.ClassificationDao;
import edu.wfu.preparedDishes.commodity.entity.ClassificationEntity;
import edu.wfu.preparedDishes.commodity.service.ClassificationService;


@Service("classificationService")
public class ClassificationServiceImpl extends ServiceImpl<ClassificationDao, ClassificationEntity> implements ClassificationService {

    @Autowired
    ClassificationDao dao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ClassificationEntity> page = this.page(
                new Query<ClassificationEntity>().getPage(params),
                new QueryWrapper<ClassificationEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<ClassificationEntity> queryByMerchantId(String merchantId) {

        return dao.queryByMerchantId(merchantId);
    }

}